home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-02
/
prodpack.zip
/
DB4PPSAM.EXE
/
OPEN.PRG
< prev
next >
Wrap
Text File
|
1993-05-04
|
2KB
|
89 lines
PROCEDURE Open
*----------------------------------------------------------------------------
* NAME
* Open - Calls the OpenFile dialog box
*
* DESCRIPTION
*
*----------------------------------------------------------------------------
*------------------------------------------------
*-- Code from Procedure IOpenFile in Openfile.prg
*------------------------------------------------
PUBLIC ARRAY OPENFILE[ 6 ]
*-- CS_FILE_1 - XXXXXXXXXXXXXXX
OPENFILE[ 1 ] = "*.SCR" + SPACE( 75 )
*-- CL_TYPE_1 - XXXXXXXXXXXXXXXXXXXXXXXXXXXXX [v]
OPENFILE[ 2 ] = 'Screen files (*.scr)' + SPACE( 11 )
*-- CK_READ_1 - [ ] ~Read-only
OPENFILE[ 3 ] = .F.
*-- BT_DEMO - ~Demo dialog
OPENFILE[ 4 ] = .F.
*-- BT_OK - Ok
OPENFILE[ 5 ] = .T.
*-- BT_CANCEL - Cancel
OPENFILE[ 6 ] = .F.
*--------------------------------------------------------------
*-- FXL_Cancel is set to .T. is the user Cancels the dialog box
*--------------------------------------------------------------
FXL_Cancel = .F.
*--------------------------------------------------------------
*-- FXL_NoChng lets the dialog box know that the values in the
*-- array are not different from the SCR file defaults. This
*-- will allow the dialog box to use the .WIN file for a faster
*-- startup.
*--------------------------------------------------------------
FXL_NoChng = .T.
DO OPENFILE
IF .NOT. FXL_Cancel && The user clicked on OK
*-----------------------------------
*-- Put your Ok processing code here
*-----------------------------------
openfile[ 1 ] = TRIM( openfile[ 1 ] )
cExt = _FileType( openfile[ 1 ] )
DO CASE
CASE cExt = "PRG"
IF ED( openfile[ 1 ] )
ENDIF
CASE cExt = "SCR"
MODIFY SCREEN ( openfile[ 1 ] )
CASE cExt = "DBF"
IF OPENFILE[ 3 ] && Is it read-only?
USE ( openfile[ 1 ] ) NOUPDATE
ELSE
USE ( openfile[ 1 ] )
ENDIF
BROWSE
CASE cExt = "DBO"
DO &openfile[1]
OTHERWISE
DO _Err_Box WITH [Don't know how to open: ] + TRIM( openfile[ 1 ] )
ENDCASE
ENDIF
RELEASE OPENFILE
RETURN
*-- EOP: Open WITH